﻿<%@ Page Title="" Language="VB" MasterPageFile="~/MasterPage.master" AutoEventWireup="false" CodeFile="ListaAulas.aspx.vb" Inherits="Aula_ListaAulas" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" Runat="Server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
    
    <div class="ui-widget-content ui-corner-all">
        <div class="ui-widget-header ui-corner-all title">Administracion de Aulas</div>
        <div class="content">
            <div style="overflow:hidden;">
                <div style="float: left; overflow:hidden; width: 300px;overflow:hidden">
                    <asp:HyperLink ID="NewAulaHyperLink" runat="server"
                        CssClass="button"
                        Text="Nueva Aula"
                        NavigateUrl="~/Aula/FormularioAula.aspx">
                    </asp:HyperLink>
                </div>
                <div style="float:right; width: 600px;overflow:hidden">
                    <asp:TextBox ID="SearchAulaTextBox" runat="server"
                        CssClass="biggerField">
                    </asp:TextBox>
                    <asp:LinkButton ID="SearchLinkButton" runat="server"
                        Text="Buscar"
                        OnClick="SearchLinkButton_Click"
                        CssClass="button">
                    </asp:LinkButton>
                </div>
            </div>
            <div class="gridContainer">
                <asp:GridView ID="AulaGridView" runat="server"
                    DataSourceID="AulasObjectDataSource"
                    GridLines="None"
                    CssClass="grid"
                    RowStyle-CssClass="row"
                    HeaderStyle-CssClass="header"
                    AutoGenerateColumns="false"
                    Width="100%"
                    AlternatingRowStyle-CssClass="altRow">
                    <Columns>
                        <asp:BoundField DataField="Nombre" HeaderText="Nombre" />
                        <asp:BoundField DataField="Descripcion" HeaderText="Descripcion" />
                        <asp:BoundField DataField="EstadoForDisplay" HeaderText="Estado" />
                        <asp:TemplateField>
                            <ItemTemplate>
                                <asp:LinkButton ID="EditarLinkButton" runat="server"
                                    Text="Editar"
                                    CommandName="Editar"
                                    CommandArgument="<%# Bind('AulaId') %>">
                                </asp:LinkButton>
                            </ItemTemplate>
                        </asp:TemplateField>
                        <asp:TemplateField>
                            <ItemTemplate>
                                <asp:LinkButton ID="EliminarLinkButton" runat="server"
                                    Text="Eliminar"
                                    CommandName="Eliminar"
                                    CommandArgument="<%# Bind('AulaId') %>">
                                </asp:LinkButton>
                            </ItemTemplate>
                        </asp:TemplateField>
                    </Columns>
                    <EmptyDataTemplate>
                        <div class="center">
                            No existen aulas registradas en el sistema
                        </div>
                    </EmptyDataTemplate>
                </asp:GridView>

                <asp:ObjectDataSource ID="AulasObjectDataSource" runat="server"
                    TypeName="AulaCRN"
                    OnSelected="AulasObjectDataSource_Selected"
                    SelectMethod="GetAulaBySearch">
                    <SelectParameters>
                        <asp:ControlParameter ControlID="SearchAulaTextBox" PropertyName="Text" Name="searchTerm" Type="String" />
                    </SelectParameters>
                </asp:ObjectDataSource>
            </div>
        </div>
    </div>

</asp:Content>

